package top.ywlog.permission.controller;

import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.ywlog.permission.common.request.AclParam;
import top.ywlog.permission.common.response.Result;
import top.ywlog.permission.service.SysAclService;

import javax.annotation.Resource;

/**
 * @author: Durian
 * @date: 2020/10/24 18:31
 * @description:
 */
@Validated
@Controller
@RequestMapping("/sys/acl")
public class SysAclController
{
    @Resource
    private SysAclService sysAclService;

    @PostMapping("/save")
    @ResponseBody
    public Result saveAcl(@RequestBody @Validated AclParam aclParam)
    {
        sysAclService.saveAcl(aclParam);
        return Result.success();
    }

    @PutMapping("/update")
    @ResponseBody
    public Result updateAcl(@RequestBody @Validated AclParam aclParam)
    {
        sysAclService.update(aclParam);
        return Result.success();
    }
}
